	<template>
		<view>
			<cu-custom :isBack="true" bgColor="bg-blue">
				<block slot="content">批次质量统计</block>
				<template slot="backText">
					<text class="cuIcon-back" @tap="beforePage"></text>
				</template>
			</cu-custom>
			<!-- 主题内容 -->
			<view  class="public-main">
				<view class="public-main-info">
					<view class="u-main">
						<view class="">
							<scroll-view scroll-y="true" @scrolltolower="lower">
								<view class="cu-timeline" v-for="(item, index) in list" :key="index">
									<view class="cu-time font-size28 u-font-weight">{{item.time}}</view>
									<view class="cu-item">
										<view class="flex">
											<view class="basis-df">
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">材质</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.material}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">规格</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.specification}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">块数</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.number}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">厚度命中率</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.thicknessRate}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">宽度命中率</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.widthRate}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">平直度命中率</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.flatnessRate}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">楔形命中率</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.wedgeRate}}</text>
												</view>
											</view>
											<view class="basis-df">
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">凸度命中率</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.convexityRate}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">精轧温度</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.fmTemp}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">卷取温度</text>
													<text class="u-font-weight font-size22 margin-left-10">{{item.dcTemp}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">过程质量</text>
													<text class="u-font-weight font-size22 margin-left-10 batch-green">{{item.processQuality}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">外观尺寸</text>
													<text class="u-font-weight font-size22 margin-left-10 batch-red">{{item.physicalDimension}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">性能</text>
													<text class="u-font-weight font-size22 margin-left-10 batch-yellow">{{item.performance}}</text>
												</view>
												<view class="margin-b-10">
													<text class="u-font-weight6 font-size22 text-right" style="width: 150upx;display: inline-block;">综合判定</text>
													<text class="u-font-weight font-size22 margin-left-10 batch-green">{{item.comprehensive}}</text>
												</view>
											</view>
										</view>
									</view>
								</view>
								<view class="text-center" v-show="flag">
									{{info}}
								</view>
							</scroll-view>
						</view>
					</view>
				</view>
			</view>
			<view class="cu-tabbar-height"></view>
		</view>
	</template>
	
	<script>
		import { post } from "@/lib/Util.js";
		import {GET_PI_QUALITY_INFO} from '@/common/api/quality.js'
		export default {
			data () {
				return {
					pageSize: 10,
					pageIndex: 1,
					info: '正在加载中……',
					flag: false,
					list: []
				}
			},
			mounted() {
				this.getInfo()
			},
			methods: {
				beforePage() {
					uni.navigateBack({
						delta: 1
					});
				},
				async getInfo() {
					let res = await post(GET_PI_QUALITY_INFO, {
						page: this.pageIndex,
						size: this.pageSize
					})
					if(res.code == 0) {
						if(res.data.length == 0) {
							this.info = '已经到底了'
						}else {
							this.list = this.list.concat(res.data)
							this.flag = false
						}
						
					}
				},
				lower(e) {
					if (e.target.direction == "bottom") {
						this.flag = true
						this.info = '加载中……'
						++this.pageIndex
						this.getInfo()
					}
				}
			}
		}
	</script>
	
	<style>
		
	</style>
